/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package dale2507.gates;

import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;

/**
 *
 * @author Dale
 */
public class Messenger {
    
    public static final ChatColor INFO = ChatColor.AQUA;
    public static final ChatColor SUCCESS = ChatColor.GREEN;
    public static final ChatColor ERROR = ChatColor.RED;
    
    /**
     * Sends a formatted message to the specified command sender
     * @param cs Person to send the message to
     * @param color Chat color of the message. Not used if the command sender is not a player.
     * @param message The message to send.
     */
    public static void sendMessage(CommandSender cs, ChatColor color, String message) {
        if (cs instanceof Player) {
            cs.sendMessage(color + ChatColor.stripColor(message));
        } else {
            cs.sendMessage(ChatColor.stripColor(message));
        }
    }
    
}